<include file="Admin/Public/Header" />
<style type="text/css">
    .layui-layer-tips{width:auto !important;}
</style>
<script src="__SCRIPT__/common.js" type="text/javascript"></script>
<script src="__PUBLIC__/Layer/layer.js" type="text/javascript"></script>
<table width="100%" height="31px" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
    <tr>
        <td height="31"><div class="titlebt">会员列表</div></td>
    </tr>
</table>

<div class="main">
    <div class="operate">
        <div class="left">
            <input type="button" onclick="window.open('{:U('Admin/Member/Add')}','main')" target="main" class="btn_blue" value="添加">
        </div>
        <div class="left_pad">
            <form method="get" action="{:U('Admin/Member/Search', 'do=Search')}">
                <input type="text" name="keyword" title="关键字" class="inp_default" value="{$keyword}" placeholder="请输入用户名/手机号/邮箱">
                <input type="submit" class="btn_blue" value="查  询">
            </form>
        </div>
    </div>
    <div class="list">
        <form action="{:U('Game/GameList', 'do=sort')}" method="post" id="form_do" name="form_do">


            <table width="100%">
                <tr>
                    <!--<th><input  name="chkall" type="checkbox" id="chkall" onClick="selectall(this.form)"></th>-->
                    <th>编号</th>
                    <th style="text-align:left;">用户名</th>
                    <th>电话</th>
                    <th>邮箱</th>
                    <th>QQ</th>
                    <th>注册时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>

                <empty name="list">

                    <tr>
                        <td colspan="9">本区域暂无数据显示...</td>
                    </tr>
                    <else />
                    <volist name='list' id='v'>
                        <tr>
                            <td>{$v.member_id}</td>
                            <td class="aleft">
                                <a href="javascript:;" uid="{$v.user_id}" class="username" target="_self">{$v.member_name|replacement=###}</a>
                            </td>
                            <td>{$v.member_mobile}</td>
                            <td>{$v.member_email}</td>
                            <td>{$v.member_qq}</td>
                            <td>{$v.member_time|date='Y-m-d H:i:s', ###}</td>
                            <td><if condition="$v['member_status'] == 1"><span class="green">已激活</span><else /><span class="red">已禁用</span></if></td>
                            <td>
                                <a href="{:U('Admin/Member/Edit','uid='.$v['member_id'])}">编辑</a>
                                <if condition="$v['member_status'] == 0">
                                    <a href="{:U('Admin/Member/Unlock','uid='.$v['member_id'])}" class="delete-one">激活</a>
                                    <else />
                                    <a href="{:U('Admin/Member/Lock','uid='.$v['member_id'])}" class="active-one">禁用</a>
                                </if>
                            </td>
                        </tr>
                    </volist>
                </empty>


            </table>
        </form>

    </div>

    <div class="page">
        {$page}
    </div>

</div>
<include file="Public/Copyright" />
<script type="text/javascript">
    $('.delete-one').click(function(){
        if( ! window.confirm('确定要禁用此用户吗？') ){
            return false;
        }
    });

    $('.username').click(function(){
        var _this = $(this);
        $.post("{:U('/Api/UserInfo')}", {
            uid: _this.attr('uid')
        }, function(data){
            layer.tips(data, _this, {
                width: '100%',
                time: 0
            });
            $(document).click(function(){
                layer.closeAll()
            });
        });
    });


</script>
</body>
</html>
